load("@prelude//toolchains/android/tools:build_rules.bzl", "buck_java_binary", "buck_kotlin_library")
load("@prelude//utils:source_listing.bzl", "source_listing")

oncall("android_devxx")

source_listing()

buck_kotlin_library(
    name = "k2-jvm-abi-gen-lib",
    srcs = glob(
        [
            "**/*.kt",
        ],
    ),
    labels = ["codegen_rule"],
    provided_deps = [
        "prelude//toolchains/android/third-party:kotlin-compiler-embeddable",
    ],
    resources = glob(["resources/**"]),
    resources_root = "resources",
    visibility = [
        "PUBLIC",
    ],
    deps = [
        "prelude//toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/common:common",
        "prelude//toolchains/android/src/com/facebook/buck/jvm/kotlin/compilerplugins/kosabi/common/stub:stub",
        "prelude//toolchains/android/third-party:kotlin-metadata-jvm",
        "prelude//toolchains/android/third-party:kotlin-stdlib",
        "prelude//toolchains/android/third-party:kotlinx-coroutines-core-jvm",
    ],
)

buck_java_binary(
    name = "k2-jvm-abi-gen",
    visibility = ["PUBLIC"],
    deps = [":k2-jvm-abi-gen-lib"],
)
